#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <vector>
using namespace std;



int main() {
	int n;
	cin >> n;
	vector<int> arr(6);
	while (n--) {
		int c = 0;
		while (c < 6) {
			cin >> arr[c++];
		}

		bool flag = false;
		for (int i = 0; i < 4 && !flag; i++) {
			for (int j = i + 1; j < 5 && !flag; j++) {
				for (int k = j + 1; k < 6 && !flag; k++) {
					if (arr[i] + arr[j] > arr[k]
						&& arr[k] + arr[j] > arr[i]
						&& arr[k] + arr[i] > arr[j]) {
						int cur = 0, m = 0;
						vector<int> temp(3);
						while (cur < 6) {
							if (cur != i && cur != j && cur != k)
								temp[m++] = cur;
							cur++;
						}

						if (arr[temp[0]] + arr[temp[1]] > arr[temp[2]]
							&& arr[temp[1]] + arr[temp[2]] > arr[temp[0]]
							&& arr[temp[0]] + arr[temp[2]] > arr[temp[1]]) {
							cout << "Yes" << endl;
							flag = true;
						}
					}

				}
			}
		}
		if (!flag)
			cout << "NO" << endl;
	}
	return 0;
}